<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //检测获取字符串的长度length
        var str = 'my name is pyy';//14个字符 空格也算
        console.log(str.length);//14
        //字符串的拼接 +
        console.log('我是'+'彭于晏');//字符串的 我是彭于晏
        console.log('彭于晏'+666);//彭于晏666
        console.log('彭于晏'+true);//彭于晏true
        console.log(12+12);//24
        console.log('12'+12);'1212'
        //数值相加，字符相连
        var age = 18;
        console.log('你'+age+'岁');
    </script>
</head>
<body>
    
</body>
</html>